<?php
/**
 * TODO Hacer!!!!!!!!!
 * $Id: grabarMovimientoProveedorChequePropio.json.php 22 2010-07-16 05:09:41Z corlatti $
 * @author Claudio Corlatti
 *
 */
header ( 'Content-type: application/json' );
require '../library/bootstrap/prepend.php';
IncludeHelper::inc ( 'library/dto/response/GenericResponse.class.php' );
IncludeHelper::inc ( 'library/session/CuentasCostos.class.php' );
IncludeHelper::inc ( 'library/session/Caja.class.php' );

$idCliente = $_POST ['idCliente'];
$emision = $_POST['emision'];
$importe = $_POST['importe'];
$fechaDeposito = $_POST['fechaDeposito'];
$banco = $_POST['banco'];
$observaciones = $_POST['observaciones'];
$fechaFija = $_POST['fechaFija'];
$articulo = $_POST['articulo'];
$result = new GenericResponse ( );
try {
	
	$caja = new Caja ( );
	
	$caja->checkRequired ( array ('idCliente' => $idCliente, 'emision' => $emision,
									 'importe' => $importe, 'fechaDeposito' => $fechaDeposito,
										'banco' => $banco ) );
	
	$obj = $caja->grabarMovimientoChequePropio ( $idCliente, $emision, $importe, $fechaDeposito, $banco, $observaciones, $fechaFija, $articulo);
	$result->result->set ( true, 'OK' );
	$result->valores[0] = $obj;

} catch ( Exception $e ) {
	
	$result->result->set ( false, $e->getMessage () );

}

echo json_encode ( $result );
?>